<?php

namespace app\middleware;

use \ltcms\middleware\Middleware_contract;

class LoginPage implements Middleware_contract
{
    /**
     *  处理请求
     */
    public function handle($request, \Closure $next)
    {
        //判断登录请求
        $isLogin=config("session.adminLogin.isLogin");
        if (session()->get($isLogin, "0")) {
            return redirect(LTCMS_ROUTE_PREFIX);
        }
        $response = $next($request);
        return $response;
    }
}


